﻿@using Microsoft.AspNetCore.Mvc.Rendering
@using Shop.Base.Entity.Assist
@using Shop.Base.Entity.View;
@using Shop.Entity
@using Shop.Tools
@using Shop.Web.Models
@{
    var userInfo = Context.Session.Get<ComUser>(SessionKeys.UserInfo);
    var systemMenu = Context.Session.Get<List<SystemMenuHelp>>(SessionKeys.Authority); 
    var urls = this.Url;
    var buttons = "[]";
    var area = urls.ActionContext.ActionDescriptor.RouteValues["area"];
    var controller = urls.ActionContext.ActionDescriptor.RouteValues["controller"];
    var action = urls.ActionContext.ActionDescriptor.RouteValues["action"];
    var menu = Context.Session.Get<List<UserRoleFunction>>(SessionKeys.UserMenu);
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>@ViewData["Title"] - 后台管理</title>
    <link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/lib/element-ui/theme-chalk/index.css" />
    <link rel="stylesheet" href="/lib/font-awesome/css/all.min.css" />
    <link rel="stylesheet" href="/lib/simple-line-icons/css/simple-line-icons.min.css" />
    <link rel="stylesheet" href="/css/styles.css" />
    <link rel="stylesheet" href="/css/website.css" asp-append-version="true" />
    @RenderSection("Styles",false)
</head>
<body>
    <div class="page-wrapper">
        <nav class="navbar page-header">
            <a href="#" class="btn btn-link sidebar-mobile-toggle d-md-none mr-auto">
                <i class="fa fa-bars"></i>
            </a>

            <a class="navbar-brand" asp-area="Admin" asp-controller="Default" asp-action="Index">
                <img src="/image/dsicon.png" alt="logo" width="30" height="30"><span style="font-weight: bolder;">后台管理</span>
            </a>

            <a href="#" class="btn btn-link sidebar-toggle d-md-down-none">
                <i class="fa fa-bars"></i>
            </a>

            <ul class="navbar-nav ml-auto">
                <li class="nav-item d-md-down-none">
                    欢迎 @userInfo.UserName &nbsp;
                </li>
                <li class="nav-item d-md-down-none">
                    <a asp-area="" asp-controller="Home" asp-action="Index">
                        <i class="icon-arrow-right-circle"></i>
                        返回商城
                    </a>
                </li>
                &nbsp; &nbsp; &nbsp;
                <li class="nav-item d-md-down-none">
                    <a asp-area="Admin" asp-controller="SystemUser" asp-action="ChangePasswd">
                        <i class="el-icon-edit"></i>
                        修改密码
                    </a>
                </li>
                &nbsp; &nbsp; &nbsp;
                <li class="nav-item d-md-down-none">
                    <a asp-area="" asp-controller="Login" asp-action="Logout">
                        <i class="icon-logout"></i>
                        退出
                    </a>
                </li>
            </ul>
        </nav>

        <div class="main-container" style="width: 99%;">
            <div class="sidebar">
                <nav class="sidebar-nav">
                    <ul class="nav">
                        <li class="nav-title">
                            菜单
                        </li> 
                        @SystemHelper.CreateMenuTree(systemMenu, area,controller) 
                    </ul>
                </nav>
            </div>
            <div class="content">
                <div class="alert alert-dismissible alert-primary" id="sysMsg" style="display: none;">
                    <span id="sys_Msg_txt"></span>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close" onclick="closeAlert()">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                @RenderBody()
            </div>
        </div>
    </div>
    @* 系统等待加载框 *@
    <div class="el-loading-mask is-fullscreen" style="background-color: rgba(0, 0, 0, 0.25); z-index: 2000; display: none; " id="loadings"><div class="el-loading-spinner"><i class="el-icon-loading" style="font-size: 7em;"></i><p class="el-loading-text" id="loadings-text" style="font-size: 2em;">Loading</p></div></div>
    <environment include="Development">
        <script src="~/lib/jquery/dist/jquery.js"></script>
    </environment>
    <environment exclude="Development">
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" asp-fallback-src="~/lib/jquery/dist/jquery.min.js" asp-fallback-test="window.jQuery" crossorigin="anonymous" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="></script>
    </environment>
    <script src="/lib/vue/vue.min.js"></script>
    <script src="/lib/arrayExtend/arrayExtend.min.js"></script>
    <script src="/lib/element-ui/index.js"></script>
    <script type="text/javascript">var currentUrl = '@("/"+area+"/"+controller)'; var btns=@SystemHelper.GetButton(menu,area,controller) </script>
    <script src="/js/carbon.js" charset="UTF-8"></script>
    @RenderSection("Scripts", required: false)
</body>
</html>
